<!DOCTYPE html>
<html>

<head lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta name="description" content="58新媒体">
    <meta name="keywords" content="58新媒体" />
    <title>58新媒体-套餐管理</title>
    <link href="../images/web.ico" rel="icon">
    <link href="../lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="../lib/bootstrap/css/font-awesome.min.css" rel="stylesheet" />
    <link href="../css/style.css" rel="stylesheet">
    <link href="../css/animate.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="../css/sweetalert.css">
    <link href="../plugins/validator/css/bootstrapValidator.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="../plugins/validator/css/bootstrap-datetimepicker.min.css"/>
    <!---让IE9以下浏览器支持响应式布局---->
    <!--[if lt IE 9]>
    <script src="../plugins/ie/html5shiv-3.7.0.js"></script>
    <script src="../plugins/ie/respond-1.3.0.min.js"></script>
    <![endif]-->
</head>

<body>
<!--加载--->
<div class="loading-container">
    <div class="sk-spinner sk-spinner-wave">
        <div class="sk-rect1"></div>
        <!--此注释用于消除‘display: inline-block;’布局下标签自动生成的空白边距，请勿删除
    -->
        <div class="sk-rect2"></div>
        <!--
    -->
        <div class="sk-rect3"></div>
        <!--
    -->
        <div class="sk-rect4"></div>
        <!--
    -->
        <div class="sk-rect5"></div>
    </div>
</div>
<!--导航-->
<div class="navbar navbar-inner">
    <div class="container-fluid">
        <div class="">
            <a class="navbar-header pull-left logo" href="../../index.html">
                58新媒体管理平台
            </a>
            <div class="sidebar-collaps" id="sidebar-collapse" style="display: inline-block">
                <i class="collapse-icon glyphicon glyphicon-align-justify"></i>
            </div>
            <ul class="nav navbar-nav navbar-right navbar-custom-menu">
                <li class="dropdown">
                    <a href="#" title="警告"><i class="fa fa-exclamation-triangle"></i></a>
                </li>
                <li class="dropdown messages-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" title="邮件"><i class="fa fa-envelope-o"></i><span class="label label-success badge-s">4</span></a>
                    <ul class="dropdown-menu">
                        <li class="header">你有4封未读邮件</li>
                        <li>
                            <div class="slimScrollDiv">
                                <ul class="menu">
                                    <li>
                                        <a href="#">
                                            <div class="pull-left"><img src="../images/head-portrait/0.jpg" class="img-circle"></div>
                                            <h4>五大新型Python框架！<small>两小时前</small></h4>
                                            <p>更快、更简单，更“Python化”——这就是Python生态系统中各类新型Web框架的终极诉求。在今天的文章中，我们将介绍五款面向Python的新型Web与网络框架，它能够切实提升速度表现、充分发挥突破性新特性，同时带来实现新思路的更多可行途径。</p>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <div class="pull-left"><img src="../images/head-portrait/4.jpg" class="img-circle"></div>
                                            <h4>从传统架构到云上数据<small>昨天</small></h4>
                                            <p>从传统的架构到云上大数据，实现了很多的转变。传统的大数据平台计算和数据一般都在一起，到云上之后计算有可能是虚拟机、有可能是容器，存储和计算是分离的。任何计算节点访问存储时都是通过高速互联网络把数据迁移到本地来。</p>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <div class="pull-left"><img src="../images/head-portrait/2.jpg" class="img-circle"></div>
                                            <h4>Windows常见故障<small>昨天</small></h4>
                                            <p>任何使用Windows系统的用户都碰到过各种各样的问题，其中一些次要的问题不但会引起你的烦恼，还会给你的工作效率带来负面影响。而那些主要的问题则可能会导致你的程序崩溃，且让你需要重新启动系统。</p>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <div class="pull-left"><img src="../images/head-portrait/3.jpg" class="img-circle"></div>
                                            <h4>移动应用开发从何入手？<small>昨天</small></h4>
                                            <p>移动应用的开发方式多种多样。虽然从技术层面了解混合与原生应用间的区别非常重要，但更重要的仍然是立足业务层面思考具体决策会给开发团队及客户带来哪些影响。事实上，混合与原生之争久已有之，且双方在使用体验、技术、投资回报以及业务影响等层面皆各擅胜场。</p>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                        <li class="footer">
                            <a href="#">查看所有邮件</a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown messages-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" title="通知"><i class="fa fa-bell-o"></i><span class="label label-warning badge-s">10</span></a>
                    <ul class="dropdown-menu">
                        <li class="header">你有10条新消息</li>
                        <li>
                            <div class="slimScrollDiv">
                                <ul class="menu">
                                    <li>
                                        <a href="#">
                                            <i class="fa fa-user-circle-o text-yellow"></i>管理员发布了新新闻
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <i class="fa fa-user-o text-red"></i>您有3次登录失败的记录
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <i class="fa fa-user-o text-info"></i>Wihend刚刚成为了超级会员
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <i class="fa fa-group text-aqua"></i>新同事向您发出邀请
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <i class="fa fa-group text-green"></i>有新员工加入
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                        <li class="footer">
                            <a href="#">查看所有消息</a>
                        </li>
                    </ul>
                </li>

                <li class="dropdown messages-menu">
                    <a href="#" class="dropdown-toggle animation-info" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" title="消息"><i class="fa fa-commenting"></i></a>
                    <ul class="dropdown-menu">
                        <li class="header">有2位联系人给你发来了消息</li>
                        <li>
                            <div class="slimScrollDiv">
                                <ul class="menu">
                                    <li>
                                        <a href="#">
                                            <div class="pull-left"><img src="../images/head-portrait/0.jpg" class="img-circle"></div>
                                            <p>Divyia</p>
                                            <h5>在线<small>1小时前</small></h5>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <div class="pull-left"><img src="../images/head-portrait/4.jpg" class="img-circle"></div>
                                            <p>Johnson</p>
                                            <h5>在线<small>3小时前</small></h5>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                    </ul>
                </li>
                <li class="dropdown messages-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><img src="../images/head-portrait/3.jpg" class="user-img"><span class="hedden-xs"> 欢迎您，Admin</span></a>
                    <ul class="dropdown-menu user-box">
                        <li class="user-header">
                            <img src="../images/head-portrait/3.jpg" class="img-circle" height="90">
                            <!--<p>WenQian-Web前端开发者<small>2014/04-至今</small></p>-->
                        </li>
                        <li class="user-footer">
                            <div class="pull-right">
                                <a class="btn btn-default" href="../html/login.html">退出</a>
                            </div>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container-fluid -->
</div>

<!--主体-->
<div class="main-container container-fluid">
    <div class="page-container" style="">
        <div class="page-sidebar">
            <div class="sidebar-header-wrapper">
                <div class="form-group has-group has-transparent">
                    <input type="text" class="form-control searchinput">
                    <div class="searchhelper">搜索报告、图表、电子邮件或通知</div>
                    <span class="fa fa-search has-group-feedback"></span>
                </div>
            </div>
            <ul class="nav sidebar-menu">
                <!--首页-->
                <li class="">
                    <a href="index.html">
                        <i class="glyphicon glyphicon-home menu-icon"></i>
                        <span class="menu-text"> 首页 </span>
                    </a>
                </li>
                <li class="">
                    <a href="member.html">
                        <i class="glyphicon menu-icon fa fa-user-circle"></i>
                        <span class="menu-text"> 用户管理 </span>
                    </a>
                </li>
                <li class=" ">
                    <a href="#" class="menu-dropdown">
                        <i class="glyphicon menu-icon fa fa-newspaper-o"></i>
                        <span class="menu-text"> 新闻中心 </span>
                        <i class="fa fa-angle-left menu-expand"></i>
                    </a>
                    <ul class="submenu">
                        <li class="">
                            <a href="news-classification.html">
                                <span class="menu-text">新闻分类</span>
                            </a>
                        </li>
                        <li>
                            <a href="news.html">
                                <span class="menu-text">新闻中心</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="">
                    <a href="#" class="menu-dropdown">
                        <i class="glyphicon menu-icon fa fa-video-camera"></i>
                        <span class="menu-text"> 视频中心 </span>
                        <i class="fa fa-angle-left menu-expand"></i>
                    </a>
                    <ul class="submenu">
                        <li class="">
                            <a href="video-classification.html">
                                <span class="menu-text">视频分类</span>
                            </a>
                        </li>
                        <li class="">
                            <a href="video.html">
                                <span class="menu-text">视频中心</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="#" class="menu-dropdown">
                        <i class="glyphicon menu-icon fa fa-shopping-cart"></i>
                        <span class="menu-text"> 商品中心 </span>
                        <i class="fa fa-angle-left menu-expand"></i>
                    </a>
                    <ul class="submenu">
                        <li>
                            <a href="shop-classification.html">
                                <span class="menu-text">商品分类</span>
                            </a>
                        </li>
                        <li>
                            <a href="shop.html">
                                <span class="menu-text">商品列表</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="forward.html">
                        <i class="glyphicon menu-icon fa fa-file-text-o"></i>
                        <span class="menu-text"> 提现打款 </span>
                    </a>
                </li>
                <li class="">
                    <a href="transfer.html">
                        <i class="glyphicon menu-icon fa fa-file-text-o"></i>
                        <span class="menu-text"> 转账 </span>
                    </a>
                </li>
                <li>
                    <a href="order.html">
                        <i class="glyphicon menu-icon fa fa-server menu-icon"></i>
                        <span class="menu-text"> 订单管理 </span>
                    </a>
                </li>
                <li>
                    <a href="#" class="menu-dropdown">
                        <i class="glyphicon menu-icon fa fa-calendar-minus-o"></i>
                        <span class="menu-text"> 任务管理 </span>
                        <i class="fa fa-angle-left menu-expand"></i>
                    </a>
                    <ul class="submenu">
                        <li>
                            <a href="taskType.html">
                                <span class="menu-text">任务类型</span>
                            </a>
                        </li>
                        <li>
                            <a href="taskScreenshots.html">
                                <span class="menu-text">任务截图</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="active open">
                    <a href="#" class="menu-dropdown">
                        <i class="glyphicon menu-icon fa fa-window-restore"></i>
                        <span class="menu-text"> 套餐 </span>
                        <i class="fa fa-angle-left menu-expand"></i>
                    </a>
                    <ul class="submenu">
                        <li class="">
                            <a href="meal-list.html">
                                <span class="menu-text">套餐列表</span>
                            </a>
                        </li>
                        <li class="">
                            <a href="meal-detailed.html">
                                <span class="menu-text">套餐明细</span>
                            </a>
                        </li>
                        <li class="active">
                            <a href="meal-run.html">
                                <span class="menu-text">套餐管理</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="signIn.html">
                        <i class="glyphicon menu-icon fa fa-map-marker"></i>
                        <span class="menu-text"> 签到明细 </span>
                    </a>
                </li>
                <li>
                    <a href="read.html">
                        <i class="glyphicon menu-icon fa fa-book"></i>
                        <span class="menu-text"> 阅读赚钱明细 </span>
                    </a>
                </li>
                <li>
                    <a href="distribution-commission.html">
                        <i class="glyphicon menu-icon fa fa-mail-forward"></i>
                        <span class="menu-text"> 分销佣金明细 </span>
                    </a>
                </li>
                <li class="">
                    <a href="InvitationToEarn.html">
                        <i class="glyphicon menu-icon fa fa-id-badge"></i>
                        <span class="menu-text"> 邀请赚取 </span>
                    </a>
                </li>
                <li class="">
                    <a href="notice.html">
                        <i class="glyphicon menu-icon fa fa-bullhorn menu-icon"></i>
                        <span class="menu-text"> 系统公告 </span>
                    </a>
                </li>
                <li class="">
                    <a href="store-detailed.html">
                        <i class="glyphicon menu-icon fa fa-mail-forward"></i>
                        <span class="menu-text"> 商城分销明细 </span>
                    </a>
                </li>
                <!--<li class="">
                    <a href="quotaDetails.html">
                        <i class="glyphicon menu-icon fa fa-sort-amount-desc"></i>
                        <span class="menu-text"> 额度明细 </span>
                    </a>
                </li>-->
            </ul>
        </div>

        <!---page-sidebar--->

        <div class="page-wrapper">
            <div class="page-breadcrumbs">
                <ol class="breadcrumb">
                    <li><i class="fa fa-home"></i>
                        <a href="index.html">首页</a>
                    </li>
                    <li>套餐管理</li>
                </ol>
            </div>
            <div class="page-header position-relative">
                <div class="header-title title-h1">套餐管理</div>
            </div>

            <div class="page-body">
                <!--基本表单--->
                <div class="row">
                    <!--基本表单--->
                    <div class="col-lg-12">
                        <div class="widget">
                            <div class="widget-header">
                                <div class="widget-caption">套餐管理</div>
                            </div>
                            <div class="widget-body">
                                <form id="defaultForm" method="post" class="form-horizontal" action="">
                                    <div class="form-group">
                                        <label class="col-lg-3 control-label">理财数量:<i class="red">*</i></label>
                                        <div class="col-lg-5">
                                            <input type="text" class="form-control" name="financingNumber" id="financingNumber"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-3 control-label">理财天数:<i class="red">*</i></label>
                                        <div class="col-lg-5">
                                            <input type="text" class="form-control" name="financialQuantity" id="financialQuantity"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-3 control-label">每日返还收益:</label>
                                        <div class="col-lg-5">
                                            <input type="text" class="form-control" readonly id="financialQuantity1"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-lg-9 col-lg-offset-3">
                                            <button type="button" class="btn btn-primary" id="validateBtn" name="signup" value="Sign up">提交</button>
                                            <button type="reset" class="btn btn-info" id="resetBtn">重置</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>

            </div>

        </div>
        <!--page-wrapper--->

    </div>
</div>
<!--回到顶部--->
<a id="backTop">
    <i class="fa fa-angle-up"></i>
</a>


<!-- 配置文件 -->
<!--<script type="text/javascript" src="../plugins/ueditor/ueditor.config.js"></script>-->
<!-- 编辑器源码文件 -->
<!--<script type="text/javascript" src="../plugins/ueditor/ueditor.all.js"></script>-->
<!-- 实例化编辑器 -->
<!--<script type="text/javascript">
    var ue = UE.getEditor('container', {
        autoHeightEnabled: true,
        autoFloatEnabled: true,
        initialFrameWidth:'100%',
        initialFrameHeight:'500'
    });
</script>-->
<script src="../lib/jquery/jquery.min.js" type="text/javascript"></script>
<script src="../lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../plugins/validator/js/bootstrapValidator.min.js"></script>
<script type="text/javascript" src="../js/sweetalert-dev.js"></script>
<script src="../js/desc.js"></script>
<script type="text/javascript" src="../js/public.js"></script>

<script>


    // 获取url中的参数
    function getUrlParam (name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r!= null) {
            return unescape(r[2]);
        }else{
            return null;
        }
    }

    $(function() {
        findById();
    });


    // 查询信息
    function findById() {
        $.ajax({
            url: website+"/IncomeSystemController/queryAll",
            type: "POST",
            success: function (data) {
                $("#financingNumber").val(data.data.financingNumber);
                $("#financialQuantity").val(data.data.financialQuantity);
                $("#financialQuantity1").val(parseInt(accDiv(data.data.financingNumber,data.data.financialQuantity)));

            },
        });
    }

    //乘法
    function accMul(arg1,arg2)
    {
        var m=0,s1=arg1.toString(),s2=arg2.toString();
        try{m+=s1.split(".")[1].length}catch(e){}
        try{m+=s2.split(".")[1].length}catch(e){}
        return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)
    }

    //除法
    function accDiv(arg1,arg2) {
        var t1 = 0, t2 = 0, r1, r2;
        try {
            t1 = arg1.toString().split(".")[1].length
        } catch (e) {
        }
        try {
            t2 = arg2.toString().split(".")[1].length
        } catch (e) {
        }
        with (Math) {
            r1 = Number(arg1.toString().replace(".", ""))
            r2 = Number(arg2.toString().replace(".", ""))
            return accMul((r1 / r2), pow(10, t2 - t1));
        }
    }
    /*$(".form_datetime").datetimepicker({
        format: "yyyy-mm-dd hh:ii",
        language: 'zh-CN',
        /!*minView: "month",*!/ //选择日期后，不会再跳转去选择时分秒
        todayBtn: 1,
        autoclose: 1,
        autoclose: true,
        todayBtn: true,
        minuteStep: 10,
    });*/

    $(document).ready(function() {

        // Generate a simple captcha
        function randomNumber(min, max) {
            return Math.floor(Math.random() * (max - min + 1) + min);
        };

        $('#defaultForm').bootstrapValidator({
            //        live: 'disabled',
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                classificationName: {
                    message: '无效',
                    validators: {
                        notEmpty: {
                            message: '不能为空'
                        },
                    }
                },
                selectlist: {
                    validators: {
                        notEmpty: {
                            message: '请选则'
                        },
                    },
                },
                financialQuantity: {
                    message: '内容无效',
                    validators: {
                        notEmpty: {
                            message: '不能为空'
                        },
                        digits: {
                            message: '只能为数子'
                        }
                    }
                },
                financingNumber: {
                    message: '内容无效',
                    validators: {
                        notEmpty: {
                            message: '不能为空'
                        },
                        digits: {
                            message: '只能为数子'
                        }
                    }
                },
                monthDayYear: {
                    validators: {
                        notEmpty: {
                            message: '不能为空'
                        },
                        date: {
                            format: 'yyyy-mm-dd'
                        }
                    }
                },
            }
        });

        //$('#resetBtn').click(function() {
        //		$('#defaultForm').data('bootstrapValidator').resetForm(true);
        //});

        $('#validateBtn').click(function() {
            $('#defaultForm').data('bootstrapValidator').validate();
            var id = $('#classificationId').val();
            if(!$('#defaultForm').data('bootstrapValidator').isValid()) { //判断校检是否通过
                swal({
                    title: "验证不通过",
                    type: "warning"
                });
                return;
            }
            update();
        });
    });

    /*function add() {
        var formData = new FormData($('form')[0]);
        $.ajax({
            url: website+"/NewsClassification/addClassification",
            type: "post",
            data: formData,
            contentType: false,
            processData: false,
            success: function (data) {
                if (data.code == 200) {
                    //提交动作
                    swal({
                        title: data.msg,
                        type: "success"
                    }, function() {
                        window.location.href = "news-classification.html";
                    });
                } else {
                    swal({
                        title: data.msg,
                        type: "error"
                    }, function() {
                        window.location.href = "news-classification.html";
                    });
                }
            }
        });
    }*/

    function update() {
        var formData = new FormData($('form')[0]);
        $.ajax({
            url: website+"/IncomeSystemController/revisionFinancialManagement",
            type: "post",
            data: formData,
            contentType: false,
            processData: false,
            success: function (data) {
                if (data.code == 200) {
                    //提交动作
                    swal({
                        title: data.msg,
                        type: "success"
                    }, function() {
                        window.location.reload()
                    });
                } else {
                    swal({
                        title: data.msg,
                        type: "error"
                    }, function() {
                        window.location.reload()
                    });
                }
            }
        })
    }
</script>

</body>

</html>